# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=wig
pkgver=574.d5ddd91
pkgrel=10
groups=('blackarch' 'blackarch-webapp' 'blackarch-scanner' 'blackarch-recon')
pkgdesc='WebApp Information Gatherer.'
arch=('any')
url='https://github.com/jekyc/wig'
license=('custom:BSD')
depends=('python' 'python-requests')
makedepends=('git')
source=("git+https://github.com/jekyc/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  cp -a * "$pkgdir/usr/share/$pkgname/"

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec python /usr/share/$pkgname/$pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

